<?php

use yii\db\Migration;

/**
 * Handles adding columns to table `{{%event}}`.
 */
class m230213_103321_add_new_column_to_event_table extends Migration
{
    /**
     * {@inheritdoc}
     */
    public function safeUp()
    {
        $this->addColumn('{{%event}}', 'is_main_event', $this->boolean()->notNull()->defaultValue(0));
        $this->addColumn('{{%event}}', 'is_pushkart', $this->boolean()->notNull()->defaultValue(1));
        $this->addColumn('{{%event}}', 'rars_info', $this->string());
        $this->addColumn('{{%event}}', 'kassir_bo_id', $this->string());
        $this->addColumn('{{%event}}', 'kassir_bo_type', $this->string());
        $this->addColumn('{{%event}}', 'schedule_str', $this->string(512));
    }

    /**
     * {@inheritdoc}
     */
    public function safeDown()
    {
        $this->dropColumn('{{%event}}', 'is_main_event');
        $this->dropColumn('{{%event}}', 'is_pushkart');
        $this->dropColumn('{{%event}}', 'rars_info');
        $this->dropColumn('{{%event}}', 'kassir_bo_id');
        $this->dropColumn('{{%event}}', 'kassir_bo_type');
        $this->dropColumn('{{%event}}', 'schedule_str');
    }
}
